using System;
using InfoJetSoft.Service.Entity;
using InfoJetSoft.Service.Worker;
using InfoJetSoft.Service.Manager;

namespace InfoJetSoft.Service.Util
{
	/// <summary>
	/// Summary description for ManifestUtil.
	/// </summary>
	public class ManifestUtil
	{
		
		public static string getQueryName( Manifest manifest )
		{
			if( manifest.Query != null )
			{
				if( manifest.Query.AdoAdapter != null )
				{
					return manifest.Query.AdoAdapter.Name;
				}
				if( manifest.Query.WSAdapter != null )
				{
					return manifest.Query.WSAdapter.Name;
				}
                //CID 1104 //2012.02.21 //Begin
                if (manifest.Query.SPListAdapter != null)
                {
                    return manifest.Query.SPListAdapter.Name;
                }
                //CID 1104 //2012.02.21 //End
			}
			return null;
		}

        // Erucy: Removed useless
        //public static Manifest LoadFromFolder( string folderPath )
        //{
        //    XSNConfig xsnConfig = new XSNConfig();
        //    xsnConfig.IsLoadingFromFolder = true;
        //    xsnConfig.Folder = folderPath;
        //    Manifest manifest = ManifestLoader.loadManifest( null, new InfoJetContext(), xsnConfig );
        //    return manifest;
        //}

	}
}
